package com.yyi.springcloud.service.impl;


import com.yyi.springcloud.dao.CoordonateConfigMapper;
import com.yyi.springcloud.entities.CoordonateConfigModel;
import com.yyi.springcloud.entities.CoordonateInfoVo;
import com.yyi.springcloud.entities.SensorConfigVo;
import com.yyi.springcloud.service.Local_CoordonateConfigService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Local_CoordinateConfigServiceImpl implements Local_CoordonateConfigService {

    @Resource
    private CoordonateConfigMapper coordonateConfigMapper;

    @Override
    public List<CoordonateConfigModel> getCoordonateConfigByCondition(CoordonateConfigModel coordonateConfigModel) {
        Example example = new Example(CoordonateConfigModel.class);
        example.selectProperties("coordinateno","name");
        example.setDistinct(true);
        example.setOrderByClause("coordinateno");
        example.createCriteria().andEqualTo("testunitno", coordonateConfigModel.getTestunitno());
        return coordonateConfigMapper.selectByExample(example);
    }

    @Override
    public List<CoordonateInfoVo> selectCoordinateInfo(String labcode, String versionNo) {
        return coordonateConfigMapper.selectCoordinateInfo(labcode, versionNo);
    }

    @Override
    public List<SensorConfigVo> selectSensorConfigInfo(String labcode) {
        return coordonateConfigMapper.selectSensorConfigInfo(labcode);
    }
}

